.class final Lcom/ninesky/browser/ar;
.super Landroid/os/Handler;


# instance fields
.field private synthetic a:Lcom/ninesky/browser/n;


# direct methods
.method constructor <init>(Lcom/ninesky/browser/n;)V
    .locals 0

    iput-object p1, p0, Lcom/ninesky/browser/ar;->a:Lcom/ninesky/browser/n;

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    return-void
.end method


# virtual methods
.method public final handleMessage(Landroid/os/Message;)V
    .locals 9

    const/4 v5, 0x0

    const/4 v8, 0x0

    iget v1, p1, Landroid/os/Message;->what:I

    const/16 v2, 0x66

    if-eq v1, v2, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {p1}, Landroid/os/Message;->getData()Landroid/os/Bundle;

    move-result-object v1

    const-string v2, "url"

    invoke-virtual {v1, v2}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    move-object v0, v1

    check-cast v0, Ljava/lang/String;

    move-object v7, v0

    invoke-virtual {p1}, Landroid/os/Message;->getData()Landroid/os/Bundle;

    move-result-object v1

    const-string v2, "title"

    invoke-virtual {v1, v2}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    if-eqz v7, :cond_0

    invoke-virtual {v7}, Ljava/lang/String;->length()I

    move-result v2

    if-eqz v2, :cond_0

    iget-object v2, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "webview"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/webkit/WebView;

    iget-object v3, p0, Lcom/ninesky/browser/ar;->a:Lcom/ninesky/browser/n;

    invoke-virtual {v3}, Lcom/ninesky/browser/n;->v()Landroid/view/View;

    move-result-object v3

    if-ne v3, v2, :cond_0

    iget v2, p1, Landroid/os/Message;->arg1:I

    packed-switch v2, :pswitch_data_0

    goto :goto_0

    :pswitch_0
    new-instance v2, Landroid/content/Intent;

    iget-object v3, p0, Lcom/ninesky/browser/ar;->a:Lcom/ninesky/browser/n;

    invoke-static {v3}, Lcom/ninesky/browser/n;->a(Lcom/ninesky/browser/n;)Lcom/ninesky/browser/BrowserActivity;

    move-result-object v3

    const-class v4, Lcom/ninesky/browser/AddBookmarkActivity;

    invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string v3, "url"

    invoke-virtual {v2, v3, v7}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v3, "title"

    invoke-virtual {v2, v3, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    iget-object v1, p0, Lcom/ninesky/browser/ar;->a:Lcom/ninesky/browser/n;

    invoke-static {v1}, Lcom/ninesky/browser/n;->a(Lcom/ninesky/browser/n;)Lcom/ninesky/browser/BrowserActivity;

    move-result-object v1

    invoke-virtual {v1, v2}, Lcom/ninesky/browser/BrowserActivity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    :pswitch_1
    new-instance v4, Ljava/lang/StringBuilder;

    const-string v1, "url = "

    invoke-direct {v4, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static {v4, v7}, Landroid/database/DatabaseUtils;->appendEscapedSQLString(Ljava/lang/StringBuilder;Ljava/lang/String;)V

    iget-object v1, p0, Lcom/ninesky/browser/ar;->a:Lcom/ninesky/browser/n;

    invoke-static {v1}, Lcom/ninesky/browser/n;->a(Lcom/ninesky/browser/n;)Lcom/ninesky/browser/BrowserActivity;

    move-result-object v1

    invoke-virtual {v1}, Lcom/ninesky/browser/BrowserActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    sget-object v2, Lcom/ninesky/browser/provider/e;->a:Landroid/net/Uri;

    sget-object v3, Lcom/ninesky/browser/provider/e;->b:[Ljava/lang/String;

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    move-object v6, v5

    invoke-virtual/range {v1 .. v6}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-eqz v2, :cond_4

    const/4 v2, 0x5

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x6

    invoke-interface {v1, v3}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v3

    if-eqz v3, :cond_2

    array-length v4, v3

    invoke-static {v3, v8, v4}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    :cond_2
    const/4 v3, 0x7

    invoke-interface {v1, v3}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v1

    if-eqz v1, :cond_3

    array-length v3, v1

    invoke-static {v1, v8, v3}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    :cond_3
    iget-object v1, p0, Lcom/ninesky/browser/ar;->a:Lcom/ninesky/browser/n;

    invoke-static {v1}, Lcom/ninesky/browser/n;->a(Lcom/ninesky/browser/n;)Lcom/ninesky/browser/BrowserActivity;

    move-result-object v1

    invoke-static {v1, v2, v7}, Lcom/ninesky/browser/TabControl;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_0

    :cond_4
    iget-object v1, p0, Lcom/ninesky/browser/ar;->a:Lcom/ninesky/browser/n;

    invoke-static {v1}, Lcom/ninesky/browser/n;->a(Lcom/ninesky/browser/n;)Lcom/ninesky/browser/BrowserActivity;

    move-result-object v1

    iget-object v2, p0, Lcom/ninesky/browser/ar;->a:Lcom/ninesky/browser/n;

    invoke-static {v2}, Lcom/ninesky/browser/n;->a(Lcom/ninesky/browser/n;)Lcom/ninesky/browser/BrowserActivity;

    move-result-object v2

    invoke-virtual {v2}, Lcom/ninesky/browser/BrowserActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f0700db

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v7, v2}, Lcom/ninesky/browser/an;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_0

    :pswitch_2
    if-eqz v7, :cond_0

    invoke-virtual {v7}, Ljava/lang/String;->length()I

    move-result v1

    if-eqz v1, :cond_0

    invoke-static {}, Lcom/ninesky/browser/TabControl;->a()Lcom/ninesky/browser/TabControl;

    move-result-object v1

    invoke-virtual {v1, v7}, Lcom/ninesky/browser/TabControl;->a(Ljava/lang/String;)V

    goto/16 :goto_0

    :pswitch_data_0
    .packed-switch 0x2712
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method
